home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _IECreate.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  52 lines

  1. ; *******************************************************
  2. ; Example 1 - Create a browser window and navigate to a website
  3. ; *******************************************************
  4. ;
  5. #include <IE.au3>
  6. $oIE = _IECreate ("www.autoitscript.com")
  7.  
  8. ; *******************************************************
  9. ; Example 2 - Create new browser windows pointing to each of 3 different URLs
  10. ;                if one does not already exist ($f_tryAttach = 1)
  11. ;                do not wait for the page loads to complete ($f_wait = 0)
  12. ; *******************************************************
  13. ;
  14. #include <IE.au3>
  15. _IECreate ("www.autoitscript.com", 1, 1, 0)
  16. _IECreate ("my.yahoo.com", 1, 1, 0)
  17. _IECreate ("www.google.com", 1, 1, 0)
  18.  
  19. ; *******************************************************
  20. ; Example 3 - Attempt to attach to an existing browser displaying a particular website URL
  21. ;                Create a new browser and navigate to that site if one does not already exist
  22. ; *******************************************************
  23. ;
  24. #include <IE.au3>
  25. $oIE = _IECreate ("www.autoitscript.com", 1)
  26. ; Check @extended return value to see if attach was successful
  27. If @extended Then
  28.     MsgBox(0, "", "Attached to Existing Browser")
  29. Else
  30.     MsgBox(0, "", "Created New Browser")
  31. EndIf
  32.  
  33. ; *******************************************************
  34. ; Example 4 - Create an empty browser window and populate it with custom HTML
  35. ; *******************************************************
  36. ;
  37. #include <IE.au3>
  38. $oIE = _IECreate ()
  39. $sHTML = "<h1>Hello World!</h1>"
  40. _IEBodyWriteHTML ($oIE, $sHTML)
  41.  
  42. ; *******************************************************
  43. ; Example 5 - Create an invisible browser window, navigate to a website,
  44. ;                retrieve some information and Quit
  45. ; *******************************************************
  46. ;
  47. #include <IE.au3>
  48. $oIE = _IECreate ("http://sourceforge.net", 0, 0)
  49. ; Display the innerText on an element on the page with a name of "sfmarquee"
  50. $oMarquee = _IEGetObjByName ($oIE, "sfmarquee")
  51. MsgBox(0, "SourceForge Information", $oMarquee.innerText)
  52. _IEQuit ($oIE)